package cn.pw.test.com.news.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

public class ArticleHistoryAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {

    public ArticleHistoryAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(final BaseViewHolder helper, final Object item) {
        // ImageView imgView = helper.itemView.findViewById(R.id.article_history_item_img);
//
//        String date = DateUtil.formatDate(item.createDate, FORMAT_5);
//
//        helper.setText(R.id.article_history_item_title, item.getTitle());
//        helper.setText(R.id.article_history_item_date, date);
//
//        GlideManager.loadImg(item.getImg(), imgView, R.drawable.icon_default_start_img);
//
//        helper.itemView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                ARouter.getInstance().build(NEWS_ARTICLE_DETAIL)
//                        .withString(newsArticleKey, item.getUrl())
//                        .greenChannel()
//                        .navigation();
//            }
//        });
//
//        helper.itemView.setOnLongClickListener(new View.OnLongClickListener() {
//            @Override
//            public boolean onLongClick(View v) {
//                DialogUtil.dialogBuilder(mContext, null, "您要删除这条记录吗")
//                        .setPositiveButton("确定", new DialogInterface.OnClickListener() {
//                            @Override
//                            public void onClick(DialogInterface dialog, int which) {
//                                SQLGlobal.getImp().deleteArticleHistory(item.title);
//                                getData().remove(helper.getLayoutPosition());
//                                notifyDataSetChanged();
//                            }
//                        })
//                        .setNegativeButton("取消", null)
//                        .create().show();
//                return false;
//            }
//        });
    }
}
